<html>
  <head>
    <script type="application/javascript">
      function draw() {
        var canvas = document.getElementById("canvas");
        if (canvas.getContext) {
          var ctx = canvas.getContext("2d");

          var rectangle = new Path2D();
          rectangle.rect(10, 10, 50, 50);

          var circle = new Path2D();
          circle.moveTo(125, 35);
          circle.arc(100, 35, 25, 0, 2 * Math.PI);

          ctx.stroke(rectangle);
          ctx.fill(circle);
        }
      }
    </script>
  </head>
  <body onload="draw();">
    <canvas id="canvas" width="150" height="200"></canvas>
  </body>
</html>
